package com.db4o.odbgen.plugins;

import java.util.List;

import com.db4o.odbgen.OdbgenException;
import com.db4o.odbgen.TargetLanguage;

/**
 * 
 * @author liviug
 * 
 * Each plugin must implement this.
 */
public interface Plugin {
	/**
	 * Use this to initialize the plugin.
	 * @param mainGenerator Represents the main generator used in the current run.
	 */
	void initialize(MainGeneratorPlugin mainGenerator);
	
	/**
	 * Returns whether or not this plugin supports the speciffied target language.
	 */
	boolean supportsTargetLanguage(TargetLanguage targetLanguage);
	
	/**
	 * Use this to start code generation.
	 * @throws OdbgenException In case the code generation failed. 
	 */
	void start() throws OdbgenException;
	
	/**
	 * Returns a list of plugins, this plugin depends on.
	 * This never returns null. It must return at least an empty list.
	 */
	List<Class<? extends Plugin>> getPluginDependencies();

}


